﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NetworkingLibrary.Messages
{
    [Serializable]
    public abstract class MessageObject
    {
        public byte[] Data = null;

        internal Guid UDPMessageID = Guid.NewGuid();
        internal int UDPMessageNum = 0;
        internal DateTime SentTime = DateTime.Now;
        internal System.Net.IPAddress UDPFromAddress = null;
        internal int UDPFromPort = -1;

        internal int AttemptsToSend = 0;

        public MessageObject()
        {
        }
        public MessageObject(byte[] SomeData)
        {
            Data = SomeData;
        }

        public void Regenerate()
        {
            UDPMessageID = Guid.NewGuid();
        }
    }
}
